Faithful Translations between Polyvariant Flows and Polymorphic Types
نویسندگان
چکیده
Recent work has shown equivalences between various type systems and flow logics. Ideally, the translations upon which such equivalences are based should be faithful in the sense that information is not lost in round-trip translations from flows to types and back or from types to flows and back. Building on the work of Nielson & Nielson and of Palsberg & Pavlopoulou, we present the first faithful translations between a class of finitary polyvariant flow analyses and a type system supporting polymorphism in the form of intersection and union types. Additionally, our flow/type correspondence solves several open problems posed by Palsberg & Pavlopoulou: (1) it expresses call-string based polyvariance (such as k-CFA) as well as argument based polyvariance; (2) it enjoys a subject reduction property for flows as well as for types; and (3) it supports a flow-oriented perspective rather than a type-oriented one.
منابع مشابه
A calculus with polymorphic and polyvariant flow types
We present λ, a typed λ-calculus which serves as the foundation for a typed intermediate language for optimizing compilers for higher-order polymorphic programming languages. The key innovation of λ is a novel formulation of intersection and union types and flow labels on both terms and types. These flow types can encode polyvariant control and data flow information within a polymorphically typ...
متن کاملApplying Catford’s Category Shifts to the Persian Translations of Three English Romantic Poems
This research aimed at evaluating the types and frequency of category shifts in the Persian translations of English poems based on Catford’s model of shifts. To this end, three English romantic poems of A Histo- ry of English Literature, namely, Blake’s ‘The Chimney Sweeper’, Coleridge’s ‘Kubla Khan’, and Keats’ ‘To Autumn’ along with their Persian t...
متن کاملFaithful Ideal Models for Recursive Polymorphic Types
We explore ideal models for a programming language with recursive polymorphic types, variants of the model studied by MacQueen, Plotkin, and Sethi. The use of suitable ideals yields a close t between models and programming language. Two of our semantics of type expressions are faithful, in the sense that programs that behave identically in all contexts have exactly the same types.
متن کاملCompiling with Polymorphic and Polyvariant Flow Types
Optimizing compilers for function-oriented and object-oriented languages exploit type and flow information for efficient implementation. Although type and flow information (both control and data flow) are inseparably intertwined, compilers usually compute and represent them separately. Partially, this has been a result of the usual polymorphic type systems using ∀ and ∃ quantifiers, which are d...
متن کاملGalois Embedding from Polymorphic Types into Existential Types
We show that there exist bijective translations between polymorphic λ-calculus and a subsystem of minimal logic with existential types, which form a Galois connection and moreover a Galois embedding. From a programming point of view, this result means that polymorphic functions can be represented by abstract data types.
متن کامل